<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    input {
        color: #999;
    }
</style>

<body>
    <input type="text" value="手机">
    <script>
        let inp = document.querySelector('input');
        inp.onfocus = function () {
            inp.style.color='#333';
            if (inp.value == '手机') {
                inp.value="";
            }
        }
        inp.onblur = function () {
            if (inp.value == '') {
                inp.value='手机';
            }
            inp.style.color='#999';
        }

    </script>
</body>

</html>